#include<iostream>
#include <string.h>
using namespace std;
struct user{
	char name[6];
	int num;
};

struct user use[10005];
char str1[5005][6];
char ret[10005][6];


int cmp(const void *a,const void *b){
	char *s1 = (char*)a;
	char *s2 = (char*)b;
	return strcmp(s1,s2);
}
int find(int i,int avg,int n)
{
	int l=0,r=n-1,flag = 0;
	if(strcmp(str1[l],use[i].name)<=0&&strcmp(str1[r],use[i].name)>=0){
		while(l<=r){
			int mid = (l+r)/2;
			if(strcmp(str1[mid],use[i].name)>0){
				r = mid-1;
			}
			if(strcmp(str1[mid],use[i].name)<0){
				l = mid+1;
			}
			if(strcmp(str1[mid],use[i].name)==0){
				flag = 1;
				return flag;
			}
		}
	}
	return flag;
}



int main()
{
	int n,m;
	double avg=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>str1[i];
	}
	qsort(str1,n,sizeof(str1[0]),cmp);
	cin>>m;
	for(int i=0;i<m;i++){
		cin>>use[i].name>>use[i].num;
		avg+=use[i].num;
	}
	avg = avg/m;
	
	
	int count=0;
	for(int i=0;i<m;i++){
		if(avg<use[i].num){
			if(find(i,avg,n) == 0){
				strcpy(ret[count++],use[i].name);
			}
		}
	}
	
	if(count==0){
		cout<<"Bing Mei You";
	}else{
		qsort(ret,count,sizeof(ret[0]),cmp);
		for(int i=0;i<count-1;i++){
			cout<<ret[i]<<endl;
		}
		cout<<ret[count-1];
	}
	
	return 0;
} 
